import request from '@/utils/request'

//列表
export const partnersList = (data) => {
  return request({
    url: '/code-partners/page-list',
    method: 'post',
    data
  })
}

// 新增
export const partnersAdd = (data) => {
  return request({
    url: '/code-partners/add',
    method: 'post',
    data
  })
}

// 删除
export const partnersDel = (id) => {
  return request({
    url: `/code-partners/delete/${id}`,
    method: 'post'
  })
}

// 启用
export const partnersEnable = (id) => {
  return request({
    url: `/code-partners/enable/${id}`,
    method: 'post'
  })
}

// 停用
export const partnersStop = (id) => {
  return request({
    url: `/code-partners/stop/${id}`,
    method: 'post'
  })
}

// 修改
export const partnersModify = (data) => {
  return request({
    url: `/code-partners/modify`,
    method: 'post',
    data
  })
}

// 合同展示-png
export const partnersShowImage = (id) => {
  return request({
    url: `/code-partners/showImage/${id}`,
    method: 'post'
  })
}

// 合同展示-pdf
export const partnersDownload = (id) => {
  return request({
    url: `/code-partners/download/${id}`,
    method: 'post',
    responseType: 'blob'
  })
}


// 导出
export const partnersExportExcel = (data) => {
  return request({
    url: `/code-partners/exportExcel?partnerType=${data.partnerType}&partnerName=${data.partnerName}&state=${data.state}`,
    method: 'post',
    responseType: 'blob'
  })
}
